package com.coder.gmall.list.feign;

import com.coderg.gmall.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

/**
 * @Description
 * @Author CoderG
 * @Date 2025/5/27 20:05
 **/
@FeignClient(value ="service-list",path = "/api/list")
public interface ListFeignClient {


    /**
     * 将数据库数据导入es  上架
     *
     * @param goodsId
     */
    @GetMapping(value = "/upperGoods/{skuId}")
    public Result upperGoods(@PathVariable("skuId") Long goodsId);

    /**
     * 下架商品
     * @param skuId
     * @return
     */
    @GetMapping("/lowerGoods/{skuId}")
    public Result lowerGoods(@PathVariable("skuId") Long skuId);

    /**
     * 更新商品热点incrHotScore
     *
     * @param skuId
     * @return
     */
    @GetMapping("/incrHotScore/{skuId}")
    public Result incrHotScore(@PathVariable("skuId") Long skuId);
    /**
     * 查询商品
     *
     * @param searchDate
     * @return
     */
    @PostMapping("/getGoods")
    public Result getGoodsByCondition(@RequestBody Map<String,Object> searchDate);


}
